<template>
    <div style="padding: 10px">
      <div class="headerBoxList">
        <svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 24C4 35.0457 12.9543 44 24 44V44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M36 24C36 17.3726 30.6274 12 24 12C17.3726 12 12 17.3726 12 24C12 30.6274 17.3726 36 24 36V36" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
        <span style="margin-left: 10px">挂载信息</span>
      </div>
      <div class="contentBoxYY" style="">
        <!-- <el-collapse v-model="activeName" accordion>
          <el-collapse-item style="" v-for="(item,index) in listData" :key="index" :title="'🚩 '+ item.titleKey+` （${item.content.length}行）`" :name="index">
              <div style="background: #282828;color: rgb(101, 177, 235);padding-left:20px;border: none !important;" v-for="(data,j) in item.content" :key="j">
                 {{ data }}
              </div>
          </el-collapse-item>
        </el-collapse> -->
        <div style="border-bottom: 1px solid #ebebeb;display: flex;align-items: center;" v-for="(item,index) in listData" :key="index">
        <img src="../../../../assets/guazai.png" alt="">
          <div style="margin-left: 20px;width: 280px;word-wrap: break-word;overflow-wrap: break-word;">
            <div>文件系统:{{ item.Filesystem }}</div>
            <div>数量：{{ item.cnt  }}</div>
          </div>
        </div>
      </div>
      <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="offset"
      :page-size="limit"
      :pager-count="4"
      layout="total, prev, pager, next, jumper"
      :total="total"
      style="margin-top: 10px;">
    </el-pagination>
  </div>
    </div>
</template>
  
  <script>
  import { getPhoneInFoApi } from '@/api/phoneInfo/index'
  export default {
    name: "guazai",
    props:['sendData'],
    data() {
      return {
        activeName: 0,
        listData:[],
        offset:1,
        limit:10
      };
    },
    mounted(){
      this.initFunction();
    },
    watch:{
    '$store.state.account.basePhone':function(){
      this.initFunction();
    }
  },
    created() {
      
    },
    methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.offset = val;
        this.initFunction();
      },
        initFunction(){
          let api = '/'+this.sendData.href;
        let data = {
                proof_num:this.sendData.proof_num,
                offset:this.offset,
                limit:this.limit
            }
        getPhoneInFoApi(data,api).then(res=>{
          this.listData = res.data;
          this.total = res.data[0].cnt
          // this.total = Number(this.sendData.cnt);
        }).catch(error=>{

        })
      //   let node = this.sendData;
      //   let dataJson = {
      //     "proof_num":node.proof_num,
      //     "rxTmpPath":'/'+node.subtype
      //   }
      // getRxTmpPathApi(dataJson).then(res=>{
      //   if(!res.data)return
      //   const str = res.data;

      //   let arr = str.split("\n");
      //   // console.log(arr)
      //     this.listData = arr;
      //     this.total = arr.length;
      // }).catch(error=>{
        
      // })
      }
    },
  };
  </script>
  
  <style scoped>
  .headerBoxList {
    width: 100%;
    height: 50px;
    border-bottom: 1px solid #d2d2d2;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
  }
  .contentBoxYY{
      width: 99%; 
      margin: 0 auto;
      overflow: hidden;
      height:82vh;
      overflow-y: auto;
      padding-top: 10px;
      overflow-x: hidden;
  }
  @media screen and (min-width: 2360px) {
      .contentBoxYY{
          width: 95%; 
          margin: 0 auto;
          overflow: hidden;
          height:77vh;
          overflow-y: auto;
          padding-top: 10px;
          overflow-x: hidden;
      }
  }
  @media screen and (min-width: 2561px) {
      .contentBoxYY{
          width: 95%; 
          margin: 0 auto;
          overflow: hidden;
          height:62vh;
          overflow-y: auto;
          padding-top: 10px;
          overflow-x: hidden;
      }
  }
  
  </style>